package DataAccess;

//////////////////////////////////////////////////////////////////////////
// �� �� ��: passport_online.cs
// �� �� ��: otyg
// ��������: DateTime.Now();
// ��    ��: ��װ���ݱ�[passport_online]��ز���
// ģ���޸�: 
//     2006-11-17  ֧��ChangePage�ؼ���ֻװ�ص�ǰҳ���ݹ���
//     2006-10-28  ����ͨ��DataRowView���쵥��������
//     2006-10-16  ���뼯�ϲ���foreach/Add/Remove�ȹ���,����Transaction����
// ��    Ȩ: ���������  QQ:1775068  
//////////////////////////////////////////////////////////////////////////
/** 
 Data Access Layer Object Of passport_online
*/
public class passport_online extends DataAccessBase
{
//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
		///#region ����ͻ���
	public passport_online()
	{
		super();
		_DataRow.setItem("hy_num", 0);
		_DataRow.setItem("session_id", "");
		_DataRow.setItem("login_time", java.time.LocalDateTime.MIN);
		_DataRow.setItem("login_ip", "");
	}
	public passport_online(DataRow dataRow)
	{
		super(dataRow);
	}
	public passport_online(DataRowView dataRowView)
	{
		super(dataRowView);
	}
	@Override
	protected DataRow BuildRow()
	{
		DataTable dt = new DataTable();
		dt.Columns.Add("hy_num",Integer.class);
		dt.Columns.Add("session_id",String.class);
		dt.Columns.Add("login_time",java.time.LocalDateTime.class);
		dt.Columns.Add("login_ip",String.class);
		return dt.NewRow();
	}
//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
		///#endregion ����ͻ���
//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
		///#region ����
	public final DataRow getDataRow()
	{
		return super._DataRow;
	}
	public final int gethy_num()
	{
		return Integer.parseInt(_DataRow.getItem("hy_num").toString());
	}
	public final void sethy_num(int value)
	{
		_DataRow.setItem("hy_num", value);
	}
	public final String getsession_id()
	{
		return _DataRow.getItem("session_id").toString();
	}
	public final void setsession_id(String value)
	{
		_DataRow.setItem("session_id", value);
	}
	public final java.time.LocalDateTime getlogin_time()
	{
		return java.time.LocalDateTime.parse(_DataRow.getItem("login_time").toString());
	}
	public final void setlogin_time(java.time.LocalDateTime value)
	{
		_DataRow.setItem("login_time", value);
	}
	public final String getlogin_ip()
	{
		return _DataRow.getItem("login_ip").toString();
	}
	public final void setlogin_ip(String value)
	{
		_DataRow.setItem("login_ip", value);
	}
//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
		///#endregion ����
//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
		///#region ��������
	protected final boolean DeleteByCondition(String condition)
	{
		String sql = "" + "\r\n" +
"				Delete From passport_online" + "\r\n" +
"				WHERE " + condition;
//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
//#if(DEBUG)
		super.ExecuteSQL(sql);
//#else
		try
		{
			super.ExecuteSQL(sql);
		}
		catch (java.lang.Exception e)
		{
			return false;
		}
//#endif
		return true;
	}
//		public bool Delete()
//		{
//			string condition = 
//			return DeleteByCondition(condition);
//		}

	public final boolean Insert()
	{
			String sql = "" + "\r\n" +
"				Insert Into passport_online (" + "\r\n" +
"					hy_num," + "\r\n" +
"					session_id," + "\r\n" +
"					login_time," + "\r\n" +
"					login_ip" + "\r\n" +
"				) Values (" + "\r\n" +
"					" + gethy_num() + "," + "\r\n" +
"					" + Helper.ToSQLParamStr(getsession_id()) + "," + "\r\n" +
"					" + Helper.ToSQLParamStr(getlogin_time().toString()) + "," + "\r\n" +
"					" + Helper.ToSQLParamStr(getlogin_ip()) + "\r\n" +
"				)";
//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
//#if(DEBUG)
		super.ExecuteSQL(sql);
//#else
		try
		{
			super.ExecuteSQL(sql);
		}
		catch (java.lang.Exception e)
		{
			return false;
		}
//#endif
		return true;
	}
	protected final boolean SelectByCondition(String condition)
	{
		String sql = "" + "\r\n" +
"				Select" + "\r\n" +
"					hy_num," + "\r\n" +
"					session_id," + "\r\n" +
"					login_time," + "\r\n" +
"					login_ip" + "\r\n" +
"				  From passport_online" + "\r\n" +
"				 Where " + condition + "\r\n" +
"			";
		DataTable dt;
//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
//#if(DEBUG)
		dt = super.GetDataTable(sql);
//#else
		try
		{
			dt = super.GetDataTable(sql);
		}
		catch (java.lang.Exception e)
		{
			return false;
		}
//#endif
		try
		{
			_DataRow = dt.Rows[0];
		}
		catch (java.lang.Exception e2)
		{
			return false;
		}
		return true;
	}
	public final boolean SelectByPk()
	{
		String condition = "1=1" + "\r\n" +
"			";
		return SelectByCondition(condition);
	}
	public final boolean Update()
	{
		String sql = "" + "\r\n" +
"				Update passport_online SET" + "\r\n" +
"					hy_num=" + gethy_num() + "," + "\r\n" +
"					session_id=" + Helper.ToSQLParamStr(getsession_id()) + "," + "\r\n" +
"					login_time=" + Helper.ToSQLParamStr(getlogin_time().toString()) + "," + "\r\n" +
"					login_ip=" + Helper.ToSQLParamStr(getlogin_ip()) + "\r\n" +
"				Where 1=1" + "\r\n" +
"				";
//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
//#if(DEBUG)
		return (super.ExecuteSQL(sql) == 1);
//#else
		try
		{
			return (super.ExecuteSQL(sql) == 1);
		}
		catch (java.lang.Exception e)
		{
			return false;
		}
//#endif
	}

//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
		///#endregion ��������
//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
		///#region ���淽��
	//TODO: �����ķ������������
//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
		///#endregion ���淽��
}